package com.baizhi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("cmfz_album")//专辑表
public class CmfzAlbum implements Serializable {
  /*  CREATE TABLE `cmfz_album` (
            `album_id` int(100) NOT NULL AUTO_INCREMENT,
  `album_name` varchar(100) DEFAULT NULL,
  `album_author` varchar(100) DEFAULT NULL,
  `album_teller` varchar(100) DEFAULT NULL,
  `album_Episodes` int(11) DEFAULT NULL,
  `album_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
            `album_content` varchar(1000) DEFAULT NULL,
  `album_image` varchar(100) DEFAULT NULL,
  `album_star` int(11) DEFAULT NULL,*/
  @TableId(value = "album_id",type=IdType.AUTO)
  private Integer albumId;
  private String albumName;
  private String albumAuthor;
  private String albumTeller;//播音员
  @TableField("album_Episodes")
  private Integer albumEpisodes;//集数
  @DateTimeFormat(pattern = "yyyy-MM-dd")//接收日期数据格式
  @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss")//响应的json日期格式
  private Date albumDate;
  private String albumContent;//专辑的简介
  private String albumImage;
  private Integer albumStar;//该专辑的星级
  @TableField(exist = false)//标明被标注的属性不是数据库表中原生的字段
  private List<CmfzAudio> cmfzAudios;//该专辑下的音频集合
}
